//
//  UserDao.swift
//  BellManage
//
//  Created by Bestsch on 16/3/29.
//  Copyright © 2016年 wsl. All rights reserved.
//

import Foundation


    func getUserPojo() -> UserPojo {
        let defaults = UserDefaults.standard
        let user = UserPojo()
        
        let userphone = defaults.object(forKey: "userphone")
        let password = defaults.object(forKey: "password")
        let userid = defaults.object(forKey: "userid")
        let username = defaults.object(forKey: "username")
        let usertype = defaults.object(forKey: "usertype")
        let schid = defaults.object(forKey: "schid")
        let schname = defaults.object(forKey: "schname")
        let doname = defaults.object(forKey: "doname")
        
        //超管用户
        let UpperCode = defaults.object(forKey: "UpperCode")
        let SupperType = defaults.object(forKey: "SupperType")
        
        if userphone != nil {
            user.userphone = userphone as! String
        }
        if password != nil {
            user.userpassword = password as! String
        }
        if userid != nil {
            user.userid = userid as! String
        }
        if username != nil {
            user.username = username as! String
        }
        if usertype != nil {
            user.usertype = usertype as! String
        }
        if schid != nil {
            user.schid = schid as! String
        }
        if schname != nil {
            user.schname = schname as! String
        }
        if doname != nil {
            user.doname = doname as! String
        }
        
        if UpperCode != nil {
            user.UpperCode = UpperCode as! String
        }
        if SupperType != nil {
            user.SupperType = SupperType as! String
        }
        
        return user;
    }

